<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
Route::get('admin/logout', array('as' => 'admin.logout', 'uses' => 'App\Controllers\Admin\AuthController@getLogout'));
Route::get('admin/login', array('as' => 'admin.login', 'uses' => 'App\Controllers\Admin\AuthController@getLogin'));
Route::post('admin/login', array('as' => 'admin.login.post', 'uses' => 'App\Controllers\Admin\AuthController@postLogin'));

Route::any('/', 'HomeController@index');

Route::any('pictures/upload', array(
    'as'     => 'pictures.upload',
    'uses'   => 'PicturesController@upload',
));
Route::resource('pictures', 'PicturesController');
Route::get('discern', 'CheckuserController@index');//user certification

Route::resource('rates', 'RatesController');
Route::any('materials/myindex', array(
    'as'     => 'materials.myindex',
    'uses'   => 'MaterialsController@myindex',
));
Route::resource('materials', 'MaterialsController');
Route::get('commodities/buy', array(
    'as'     => 'commodities.buy',
    'uses'   => 'CommoditiesController@buy',
));
Route::post('commodities/buy', array(
    'as'     => 'commodities.buy',
    'uses'   => 'CommoditiesController@postBuy',
));
Route::any('commodities/success', array(
    'as'     => 'commodities.success',
    'uses'   => 'CommoditiesController@success',
));
Route::resource('commodities', 'CommoditiesController');
Route::any('hello/down', array(
    'as'     => 'hello.down',
    'uses'   => 'HomeController@down',
));
Route::any('hello/shiyong_notice', array(
    'as'     => 'hello.shiyong_notice',
    'uses'   => 'HomeController@shiyong_notice',
));
Route::any('hello/check_dom', array(
    'as'     => 'hello.check_dom',
    'uses'   => 'HomeController@check_dom',
));
Route::any('hello/filter', array(
    'as'     => 'hello.filter',
    'uses'   => 'HomeController@filter',
));
Route::any('hello/filter_notice', array(
    'as'     => 'hello.filter_notice',
    'uses'   => 'HomeController@filter_notice',
));
Route::any('hello/state_count', array(
    'as'     => 'hello.state_count',
    'uses'   => 'HomeController@state_count',
));
Route::any('hello/set_old_bangding', array(
    'as'     => 'hello.set_old_bangding',
    'uses'   => 'HomeController@set_old_bangding',
));
Route::any('hello/send_img', array(
    'as'     => 'hello.send_img',
    'uses'   => 'HomeController@send_img',
));

Route::any('hello/test', array(
    'as'     => 'hello.test',
    'uses'   => 'HomeController@test',
));
Route::any('hello/upload_images', array(
    'as'     => 'hello.upload_image',
    'uses'   => 'HomeController@upload_image',
));


//Route::any('hello/get_old_and_sendsms', array(
//    'as'     => 'hello.get_old_and_sendsms',
//    'uses'   => 'HomeController@get_old_and_sendsms',
//));
Route::resource('hello', 'HomeController');
Route::resource('machines', 'MachinesController');
Route::any('customers/login', array(
    'as'     => 'customers.login',
    'uses'   => 'CustomersController@login',
));
Route::get('customers/center', array(
    'as'     => 'customers.center',
    'uses'   => 'CustomersController@center',

));
Route::post('customers/ajax_edit', array(
    'as'     => 'customers.ajax_edit',
    'uses'   => 'CustomersController@ajax_edit',
));
Route::any('customers/login_error', array(
    'as'     => 'customers.login_error',
    'uses'   => 'CustomersController@login_error',
));
Route::any('customers/reg', array(
    'as'     => 'customers.reg',
    'uses'   => 'CustomersController@reg',
));
Route::any('customers/ajax', array(
    'as'     => 'customers.ajax',
    'uses'   => 'CustomersController@ajax',
));


Route::any('pay/notify', array(
    'as'     => 'pay.notify',
    'uses'   => 'PayController@notify',
));
Route::any('pay/buy_notify', array(
    'as'     => 'pay.buy_notify',
    'uses'   => 'PayController@buy_notify',
));
Route::any('api/wechat', array(
    'as'     => 'wechat.index',
    'uses'   => 'WechatController@index',
));


Route::any('mounts/ajax', array(
    'as'     => 'mounts.ajax',
    'uses'   => 'MountsController@ajax',
));
Route::group(array('before' => 'auth.customer'), function()
{
    Route::any('mounts/first', array(
        'as'     => 'mounts.first',
        'uses'   => 'MountsController@first',
    ));
    Route::any('mounts/prepare', array(
        'as'     => 'mounts.prepare',
        'uses'   => 'MountsController@prepare',
    ));
    Route::any('mounts/prepare_store', array(
        'as'     => 'mounts.prepare_store',
        'uses'   => 'MountsController@prepare_store',
    ));
    Route::any('mounts/ajax_forwork', array(
        'as'     => 'mounts.ajax_forwork',
        'uses'   => 'MountsController@ajax_forwork',
    ));
    Route::any('customers/mounts', array(
        'as'     => 'customers.mounts',
        'uses'   => 'CustomersController@mounts',
    ));
    Route::any('customers/services', array(
        'as'     => 'customers.services',
        'uses'   => 'CustomersController@services',
    ));
    Route::any('customers/pointrecords', array(
        'as'     => 'customers.pointrecords',
        'uses'   => 'CustomersController@pointrecords',
    ));
    Route::any('customers/vip', array(
        'as'     => 'customers.vip',
        'uses'   => 'CustomersController@vip',
    ));
    Route::any('customers/normal', array(
        'as'     => 'customers.normal',
        'uses'   => 'CustomersController@normal',
    ));
    Route::any('customers/orders', array(
        'as'     => 'customers.orders',
        'uses'   => 'CustomersController@orders',
    ));
    Route::any('customers/filters', array(
        'as'     => 'customers.filters',
        'uses'   => 'CustomersController@filters',
    ));
    Route::resource('customers', 'CustomersController');
    Route::resource('buyrecords', 'BuyrecordsController');
    Route::any('mounts/fujin', array(
        'as'     => 'mounts.fujin',
        'uses'   => 'MountsController@fujin',
    ));
    Route::any('mounts/pictures', array(
        'as'     => 'mounts.pictures',
        'uses'   => 'MountsController@pictures',
    ));
    Route::any('mounts/shouhou', array(
        'as'     => 'mounts.shouhou',
        'uses'   => 'MountsController@shouhou',
    ));
    Route::any('mounts/picture', array(
        'as'     => 'mounts.picture',
        'uses'   => 'MountsController@picture',
    ));
    Route::resource('mounts', 'MountsController');
    Route::any('services/orders', array(
        'as'     => 'services.orders',
        'uses'   => 'ServicesController@orders',
    ));
    Route::any('services/paidan', array(
        'as'     => 'services.paidan',
        'uses'   => 'ServicesController@paidan',
    ));
    Route::any('services/paidan_store', array(
        'as'     => 'services.paidan_store',
        'uses'   => 'ServicesController@paidan_store',
    ));
    Route::any('pay/order/index', array(
        'as'     => 'pay.order.index',
        'uses'   => 'PayController@order',
    ));
    Route::any('pay/test/index', array(
        'as'     => 'pay.test.index',
        'uses'   => 'PayController@test',
    ));
    Route::any('pay/return', array(
        'as'     => 'pay.return',
        'uses'   => 'PayController@pay_return',
    ));
    Route::resource('services', 'ServicesController');
});


Route::group(array('prefix' => 'admin', 'before' => 'auth.admin'), function()
{
    Route::any('/', 'App\Controllers\Admin\IndexController@index');
    Route::resource('articles', 'App\Controllers\Admin\ArticlesController');
    Route::resource('pages', 'App\Controllers\Admin\PagesController');
    Route::resource('index', 'App\Controllers\Admin\IndexController');
    Route::get('staffs/export', array(
        'as'     => 'admin.staffs.export',
        'uses'   => 'App\Controllers\Admin\StaffsController@export',
    ));
    Route::resource('staffs', 'App\Controllers\Admin\StaffsController');
    Route::get('orders/suit', array(
        'as'     => 'admin.orders.suit',
        'uses'   => 'App\Controllers\Admin\OrdersController@suit',
    ));
    Route::resource('orders', 'App\Controllers\Admin\OrdersController');
    Route::resource('collocations', 'App\Controllers\Admin\CollocationsController');
    Route::any('customers/mount_info', array(
        'as'     => 'admin.customers.mount_info',
        'uses'   => 'App\Controllers\Admin\CustomersController@mount_info',
    ));
    /**
     * ajax后台修改用户等级
     */
    Route::any('customers/change', array(
        'as'     => 'admin.customers.change',
        'uses'   => 'App\Controllers\Admin\CustomersController@change',
    ));
    Route::any('customers/points', array(
        'as'     => 'admin.customers.points',
        'uses'   => 'App\Controllers\Admin\CustomersController@points',
    ));
    Route::any('customers/affiliates', array(
        'as'     => 'admin.customers.affiliates',
        'uses'   => 'App\Controllers\Admin\CustomersController@affiliates',
    ));
    Route::any('customers/points_edit', array(
        'as'     => 'admin.customers.points_edit',
        'uses'   => 'App\Controllers\Admin\CustomersController@points_edit',
    ));

    Route::any('customers/exchange', array(
        'as'     => 'admin.customers.exchange',
        'uses'   => 'App\Controllers\Admin\CustomersController@exchange',
    ));
    Route::any('customers/ajax_exchange', array(
        'as'     => 'admin.customers.ajax_exchange',
        'uses'   => 'App\Controllers\Admin\CustomersController@ajax_exchange',
    ));
    Route::any('customers/ajax_xiaoqu_exchange', array(
        'as'     => 'admin.customers.ajax_xiaoqu_exchange',
        'uses'   => 'App\Controllers\Admin\CustomersController@ajax_xiaoqu_exchange',
    ));
    Route::any('customers/ajax_xiaoqu_exchange2', array(
        'as'     => 'admin.customers.ajax_xiaoqu_exchange2',
        'uses'   => 'App\Controllers\Admin\CustomersController@ajax_xiaoqu_exchange2',
    ));
    Route::resource('customers', 'App\Controllers\Admin\CustomersController');
    Route::any('suits/ajax', array(
        'as'     => 'admin.suits.ajax',
        'uses'   => 'App\Controllers\Admin\SuitsController@ajax',
    ));
    Route::resource('suits', 'App\Controllers\Admin\SuitsController');
    Route::resource('appoints', 'App\Controllers\Admin\AppointsController');
    Route::resource('points', 'App\Controllers\Admin\PointsController');



    Route::get('staffs/maps', array(
        'as'     => 'admin.cities.maps',
        'uses'   => 'App\Controllers\Admin\CitiesController@maps',
    ));
    Route::any('cities/deleteit', array(
        'as'     => 'admin.cities.deleteit',
        'uses'   => 'App\Controllers\Admin\CitiesController@deleteit',
    ));
    Route::any('cities/set_default', array(
        'as'     => 'admin.cities.set_default',
        'uses'   => 'App\Controllers\Admin\CitiesController@deleteit',
    ));
    Route::any('cities/get_code', array(
        'as'     => 'admin.cities.get_code',
        'uses'   => 'App\Controllers\Admin\CitiesController@get_code',
    ));
    Route::any('cities/xiaoqu', array(
        'as'     => 'admin.cities.xiaoqu',
        'uses'   => 'App\Controllers\Admin\CitiesController@xiaoqu',
    ));
    Route::any('cities/export', array(
        'as'     => 'admin.cities.export',
        'uses'   => 'App\Controllers\Admin\CitiesController@export',
    ));
    Route::resource('cities', 'App\Controllers\Admin\CitiesController');

    Route::any('services/deletemount', array(
        'as'     => 'admin.services.deletemount',
        'uses'   => 'App\Controllers\Admin\ServicesController@deletemount',
    ));
    Route::any('services/mounts', array(
        'as'     => 'admin.services.mounts',
        'uses'   => 'App\Controllers\Admin\ServicesController@mounts',
    ));

    Route::any('services/shaixuan_mounts', array(
        'as'     => 'admin.services.shaixuan_mounts',
        'uses'   => 'App\Controllers\Admin\ServicesController@shaixuan_mounts',
    ));
    Route::any('services/shift', array(
        'as'     => 'admin.services.shift',
        'uses'   => 'App\Controllers\Admin\ServicesController@shift',
    ));
    Route::any('services/shiftt', array(
        'as'     => 'admin.services.shiftt',
        'uses'   => 'App\Controllers\Admin\ServicesController@shiftt',
    ));
    Route::any('services/mounts_export', array(
        'as'     => 'admin.services.mounts_export',
        'uses'   => 'App\Controllers\Admin\ServicesController@mounts_export',
    ));
    Route::post('services/paidan', array(
        'as'     => 'admin.services.paidan',
        'uses'   => 'App\Controllers\Admin\ServicesController@paidan',
    ));
    Route::resource('services', 'App\Controllers\Admin\ServicesController');
    Route::post('mounts/ajax', array(
        'as'     => 'admin.mounts.ajax',
        'uses'   => 'App\Controllers\Admin\MountsController@ajax',
    ));
    Route::get('mounts/get_mount_code', array(
        'as'     => 'admin.mounts.get_mount_code',
        'uses'   => 'App\Controllers\Admin\MountsController@get_mount_code',
    ));

    Route::any('mounts/change', array(
        'as'     => 'admin.mounts.change',
        'uses'   => 'App\Controllers\Admin\MountsController@change',
    ));

    Route::any('mounts/section', array(
        'as'     => 'admin.mounts.section',
        'uses'   => 'App\Controllers\Admin\MountsController@section',
    ));
    Route::any('mounts/xiaoqu', array(
        'as'     => 'admin.mounts.xiaoqu',
        'uses'   => 'App\Controllers\Admin\MountsController@xiaoqu',
    ));

    Route::get('mounts/{id}/pcreate', array(
        'as'     => 'admin.mounts.pcreate',
        'uses'   => 'App\Controllers\Admin\MountsController@pcreate',
    ));
    Route::get('mounts/delete_picture', array(
        'as'     => 'admin.mounts.delete_picture',
        'uses'   => 'App\Controllers\Admin\MountsController@delete_picture',
    ));


    Route::get('mounts/{id}/pedit', array(
        'as'     => 'admin.mounts.pedit',
        'uses'   => 'App\Controllers\Admin\MountsController@pcreate',
    ));
    Route::post('mounts/pstore', array(
        'as'     => 'admin.mounts.pstore',
        'uses'   => 'App\Controllers\Admin\MountsController@pstore',
    ));
    Route::resource('mounts', 'App\Controllers\Admin\MountsController');
    Route::any('pointconfigs/ajax', array(
        'as'     => 'admin.pointconfigs.ajax',
        'uses'   => 'App\Controllers\Admin\PointconfigsController@ajax',
    ));
    Route::resource('pointconfigs', 'App\Controllers\Admin\PointconfigsController');


    Route::any('works/er', array(
        'as'     => 'admin.works.er',
        'uses'   => 'App\Controllers\Admin\WorksController@er',
    ));
    Route::any('works/get_code', array(
        'as'     => 'admin.works.get_code',
        'uses'   => 'App\Controllers\Admin\WorksController@get_code',
    ));
    Route::any('works/set_paidan', array(
        'as'     => 'admin.works.set_paidan',
        'uses'   => 'App\Controllers\Admin\WorksController@set_paidan',
    ));
    Route::any('works/export', array(
        'as'     => 'admin.works.export',
        'uses'   => 'App\Controllers\Admin\WorksController@export',
    ));
    Route::any('works/deleteit', array(
        'as'     => 'admin.works.deleteit',
        'uses'   => 'App\Controllers\Admin\WorksController@deleteit',
    ));
    Route::resource('works', 'App\Controllers\Admin\WorksController');
    Route::any('commodities/deleteit', array(
        'as'     => 'admin.commodities.deleteit',
        'uses'   => 'App\Controllers\Admin\CommoditiesController@deleteit',
    ));
    Route::resource('commodities', 'App\Controllers\Admin\CommoditiesController');
    Route::any('machines/deleteit', array(
        'as'     => 'admin.machines.deleteit',
        'uses'   => 'App\Controllers\Admin\MachinesController@deleteit',
    ));
    Route::resource('machines', 'App\Controllers\Admin\MachinesController');
    Route::resource('codes', 'App\Controllers\Admin\CodesController');
    Route::resource('rates', 'App\Controllers\Admin\RatesController');
    Route::any('areas/lbs', array(
        'as'     => 'admin.areas.lbs',
        'uses'   => 'App\Controllers\Admin\AreasController@lbs',
    ));
    Route::any('areas/service_lbs', array(
        'as'     => 'admin.areas.service_lbs',
        'uses'   => 'App\Controllers\Admin\AreasController@service_lbs',
    ));
    Route::get('areas/delete', array(
        'as'     => 'admin.areas.delete',
        'uses'   => 'App\Controllers\Admin\AreasController@delete',
    ));
    Route::get('areas/wangdian', array(
        'as'     => 'admin.wangdian.index',
        'uses'   => 'App\Controllers\Admin\AreasController@wangdian',
    ));
    Route::post('areas/get_section', array(
        'as'     => 'admin.areas.get_section',
        'uses'   => 'App\Controllers\Admin\AreasController@get_section',
    ));
    Route::put('areas/service_update/{id}', array(
        'as'     => 'admin.areas.service_update',
        'uses'   => 'App\Controllers\Admin\AreasController@service_update',
    ));
    Route::resource('areas', 'App\Controllers\Admin\AreasController');


    Route::any('accounts/materials', array(
        'as'     => 'admin.accounts.materials',
        'uses'   => 'App\Controllers\Admin\AccountsController@materials',
    ));
    Route::any('accounts/materials_create', array(
        'as'     => 'admin.accounts.materials_create',
        'uses'   => 'App\Controllers\Admin\AccountsController@materials_create',
    ));
    Route::any('accounts/materials_store', array(
        'as'     => 'admin.accounts.materials_store',
        'uses'   => 'App\Controllers\Admin\AccountsController@materials_store',
    ));
    Route::any('accounts/materials_edit', array(
        'as'     => 'admin.accounts.materials_edit',
        'uses'   => 'App\Controllers\Admin\AccountsController@materials_edit',
    ));
    Route::any('accounts/materials_update', array(
        'as'     => 'admin.accounts.materials_update',
        'uses'   => 'App\Controllers\Admin\AccountsController@materials_update',
    ));
    Route::any('accounts/materials_deleteit', array(
        'as'     => 'admin.accounts.materials_deleteit',
        'uses'   => 'App\Controllers\Admin\AccountsController@materials_deleteit',
    ));
    Route::any('accounts/menus', array(
        'as'     => 'admin.accounts.menus',
        'uses'   => 'App\Controllers\Admin\AccountsController@menus',
    ));

    Route::any('menus/send', array(
        'as'     => 'admin.menus.send',
        'uses'   => 'App\Controllers\Admin\MenusController@send_menu',
    ));
    Route::any('menus/delete', array(
        'as'     => 'admin.menus.delete',
        'uses'   => 'App\Controllers\Admin\MenusController@destroy',
    ));
    Route::resource('menus', 'App\Controllers\Admin\MenusController');


    Route::any('buyrecords/hongbao', array(
        'as'     => 'admin.buyrecords.hongbao',
        'uses'   => 'App\Controllers\Admin\BuyrecordsController@hongbao',
    ));
    Route::any('buyrecords/payment', array(
        'as'     => 'admin.buyrecords.payment',
        'uses'   => 'App\Controllers\Admin\BuyrecordsController@payment',
    ));
    Route::any('buyrecords/collection', array(
        'as'     => 'admin.buyrecords.collection',
        'uses'   => 'App\Controllers\Admin\BuyrecordsController@collection',
    ));
    Route::any('buyrecords/explode', array(
        'as'     => 'admin.buyrecords.explode',
        'uses'   => 'App\Controllers\Admin\BuyrecordsController@explode',
    ));

    Route::resource('buyrecords', 'App\Controllers\Admin\BuyrecordsController');
    Route::any('buyrecords/check_order', array(
        'as'     => 'admin.buyrecords.check_order',
        'uses'   => 'App\Controllers\Admin\BuyrecordsController@check_order',
    ));



});
